﻿<div class="form-group">
    <label ng-write-whatever="What do you want to To Do?"></label>
    <input type="text" ng-model="todo.text" class="form-control" />
    <label ng-write-whatever="Who are you?"></label>
    <input type="text" ng-model="todo.user" class="form-control" />
    <label ng-write-whatever="What city are you in?"></label>
    <input type="text" ng-model="todo.city" class="form-control" />
</div>
<button ng-click="addTodoItem()">Create</button>

<div class="form-group">
    <label>Search</label>
    <input type="text" ng-model="searchTerm" class="form-control" />
</div>

<div>
    <table class="table table-bordered table-striped">
        <tr>
            <th>Text</th>
            <th>User</th>
            <th>City</th>
            <th>Date Created</th>
            <th>Date Completed</th>
            <th></th>
        </tr>
        <tr ng-repeat="t in todos | search:searchTerm track by t.id">
            <td>{{t.text}}</td>
            <td>{{t.user}}</td>
            <td>{{t.city}}</td>
            <td>{{t.dateCreated}}</td>
            <td>{{t.dateCompleted}}</td>
            <td><a href="#/todo/{{t.id}}">View</a></td>
        </tr>
    </table>
</div>